package com.xuecheng.manage_course.controller;

import com.xuecheng.api.course.CourseInfoControllerApi;
import com.xuecheng.framework.domain.course.request.CourseListRequest;
import com.xuecheng.framework.model.response.QueryResponseResult;
import com.xuecheng.manage_course.service.CourseInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/course/courseinfo")
public class CourseInfoController implements CourseInfoControllerApi {

    @Resource
    CourseInfoService courseInfoService;
    /**
     * 分页查询我的课程信息
     *
     * @param page              查询第几页
     * @param size              一页显示多少
     * @param courseListRequest 可以携带参数查询
     * @return
     */
    @Override
    @GetMapping("/list/{page}/{size}")
    public QueryResponseResult findList(@PathVariable("page") int page, @PathVariable("size") int size, CourseListRequest courseListRequest) {

        return courseInfoService.findList(page,size,courseListRequest);
    }

}
